package com.carsystem.controller;

import com.carsystem.entity.Login;
import com.carsystem.service.LoginService;
import com.carsystem.utils.Result;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/login")
public class LoginController {

    @Reference
    private LoginService loginService;

    @RequestMapping("/addAccount")
    public Result addAccount(@RequestBody Login login){
        return loginService.addAccount(login);
    }

    @RequestMapping("/selectAccount")
    public Result selectAccount(String username,String password){
        return loginService.selectAccount(username,password);
    }

    @RequestMapping("/selectByUsername")
    public Login selectByUsername(String username){
        return loginService.selectByUsername(username);
    }
}
